ATSUGetAllFontFeatures

Obtains font feature information from a style object.

OSStatus ATSUGetAllFontFeatures (
                     ATSUStyle iStyle,
                     ItemCount iMaximumFeatureCount,
                     ATSUFontFeatureType oFeatureType[],
                     ATSUFontFeatureSelector oFeatureSelector[],
                     ItemCount *oActualFeatureCount);
iStyle
A reference of type ATSUStyle. Pass a reference to a valid style object whose font feature information you want to obtain. You cannot pass NULL for this parameter.

iMaximumFeatureCount
The maximum number of feature types and selectors in the style object. Typically, this is equivalent to the number of feature types in the oFeatureType array. To determine this value, see the discussion below.

oFeatureType
An array of values of type ATSUFontFeatureType or one of the font feature types described in Font Feature Type Constants. Before calling ATSUGetAllFontFeatures, pass a pointer to memory that you have allocated for this array. If you are uncertain of how much memory to allocate, see the discussion below. On return, the array contains the font feature types that have been set in the style object.

oFeatureSelector
An array of values of type ATSUFontFeatureSelector or one of the font feature selector constants described in Apple Advanced Typography Constants. Before calling ATSUGetAllFontFeatures, pass a pointer to memory that you have allocated for this array. If you are uncertain of how much memory to allocate, see the discussion below. On return, the array contains the font feature selectors that have been set in the style object.

oActualFeatureCount
A pointer to a count. On return, the actual number of font feature types and selectors in the style object. This may be greater than the value passed in the iMaximumFeatureCount parameter. You cannot pass NULL for this parameter.

function result
A result code. See Result Codes.
DISCUSSION
The ATSUGetAllFontFeatures function obtains an array of the feature type and selector pairs corresponding to all previously set font features in a style object. You can use the value passed back in the oActualFeatureCount parameter to calculate the maximum font feature index to pass in the iFeatureIndex parameter of the function ATSUGetFontFeature.

The best way to use ATSUGetAllFontFeatures is to call it twice:

  1. Pass a reference to the style object containing the font feature in the iStyle parameter, NULL for the oFeatureType and oFeatureSelector parameters, and 0 for the other parameters. ATSUGetAllFontFeatures returns the sizes of the feature type and selector arrays in the oActualFeatureCount parameter.

  2. Allocate enough space for an array of the returned size, then call the function again, passing a pointer in the oFeatureType and oFeatureSelector parameters; on return, the pointers references arrays of feature types and selectors, respectively.
VERSION NOTES
Available beginning with ATSUI 1.0.

© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)